package com.test.shiyan2;

import java.util.Scanner;

public class gygb {
    public static void main(String[] args) {
        int bigDivisor=0;
        int mutiple=0;
        System.out.println("输入两个整数：");
        Scanner scanner = new Scanner(System.in);
        int input1 = scanner.nextInt();
        int input2 = scanner.nextInt();
        mutiple=input1*input2;
        int temp =1;
        if (input2 > input1){
            temp = input1;
            input1 = input2;
            input2 = temp;
        }
        while (temp!=0){
            temp=input1%input2;
            input1=input2;
            input2=temp;
        }
        bigDivisor=input1;
        mutiple=mutiple/bigDivisor;
        System.out.println("最大公约数是:"+bigDivisor);
        System.out.println("最小公约数:"+mutiple);
        scanner.close();
    }
}
